package i2.application.checklist.dao.jpa.impl;

import i2.application.checklist.dao.CategorieDao;
import i2.application.checklist.entities.Categorie;
import i2.application.fmw.dao.jpa.JPADAO;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Query;

public class CategorieDaoImpl extends JPADAO<Categorie> implements CategorieDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<Categorie> getAllCategoriesWithQuestions() {
		List<Categorie> categorieList = new ArrayList<Categorie>();
		Query query = entityManager.createNamedQuery("Categorie.getAllCategoriesWithQuestions"); 
		categorieList = query.getResultList();

		logger.debug("getAllCategoriesWithQuestions : {} : {}", categorieList.size(), categorieList); 
		return categorieList;
	}

}
